<template>
    <div>
        <h2>子组件</h2>
        <div>{{newCount}}</div>
        <button @click="newCount++">+</button>
        <br>
        <div>
            {{personInfo}}<br>
            <button @click="personInfo.age++">子组件中修改父组件中的属性</button>
             <button @click="personInfo={...personInfo,sex:'男'}">子组件中修改父对象</button>
        </div>
    </div>
</template>

<script>
export default {
    props:{
        count:Number,
        personInfo:Object
    },
   
    data(){
        return{
            newCount:this.count,
        }
    },
    methods:{
       
    }
}
</script>

<style>

</style>